<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Proton - Admin Template</title>

    <!-- Import google fonts - Heading first/ text second -->

    <!--[if lt IE 9]>
    <link href="http://fonts.useso.com/css?family=Open+Sans:400" rel="stylesheet" type="text/css"/>
    <link href="http://fonts.useso.com/css?family=Open+Sans:700" rel="stylesheet" type="text/css"/>
    <link href="http://fonts.useso.com/css?family=Droid+Sans:400" rel="stylesheet" type="text/css"/>
    <link href="http://fonts.useso.com/css?family=Droid+Sans:700" rel="stylesheet" type="text/css"/>
    <![endif]-->

    <!-- Favicon and touch icons -->
    <link rel="shortcut icon" href="../assets/ico/favicon.ico" type="image/x-icon"/>

    <!-- Css files -->
    <link href="../assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="../assets/css/jquery.mmenu.css" rel="stylesheet">
    <link href="../assets/css/font-awesome.min.css" rel="stylesheet">
    <link href="../assets/plugins/jquery-ui/css/jquery-ui-1.10.4.min.css" rel="stylesheet">
    <link href="../assets/css/style.min.css" rel="stylesheet">
    <link href="../assets/css/add-ons.min.css" rel="stylesheet">
    <link href="../bootstrap-table-develop/dist/bootstrap-table.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- start: JavaScript-->
    <!--[if !IE]>-->

    <script src="../assets/js/jquery-2.1.1.min.js"></script>

    <!--<![endif]-->

    <!--[if IE]>

    <script src="../assets/js/jquery-1.11.1.min.js"></script>

    <![endif]-->

    <!--[if !IE]>-->

    <script type="text/javascript">
        window.jQuery || document.write("<script src='assets/js/jquery-2.1.1.min.js'>" + "<" + "/script>");
    </script>

    <!--<![endif]-->

    <!--[if IE]>

    <script type="text/javascript">
        window.jQuery || document.write("<script src='assets/js/jquery-1.11.1.min.js'>" + "<" + "/script>");
    </script>

    <![endif]-->
    <script src="../assets/js/jquery-migrate-1.2.1.min.js"></script>
    <script src="../assets/js/bootstrap.min.js"></script>


    <!-- page scripts -->
    <script src="../assets/plugins/jquery-ui/js/jquery-ui-1.10.4.min.js"></script>
    <script src="../assets/plugins/datatables/js/jquery.dataTables.min.js"></script>
    <script src="../assets/plugins/datatables/js/dataTables.bootstrap.min.js"></script>

    <!-- theme scripts -->
    <script src="../assets/js/SmoothScroll.js"></script>
    <script src="../assets/js/jquery.mmenu.min.js"></script>
    <script src="../assets/js/core.min.js"></script>

    <!-- bootstrap table -->
    <script src="../bootstrap-table-develop/dist/bootstrap-table.js"></script>
    <script src="../bootstrap-table-develop/dist/locale/bootstrap-table-zh-CN.js"></script>


    <!-- 配置文件 -->
    <script type="text/javascript" charset="utf-8" src="../ueditor-1.4.3.3/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="../ueditor-1.4.3.3/editor_api.js"></script>
    <!-- inline scripts related to this page -->
    <!--<script src="../assets/js/pages/table.js"></script>-->


    <!-- end: JavaScript-->
</head>
</head>

<body>
<!-- start: Header -->
<div class="navbar" role="navigation">

    <div class="container-fluid">

        <ul class="nav navbar-nav navbar-right">

            <li><a href="/logout"><i class="fa fa-power-off"></i></a></li>
        </ul>

    </div>

</div>
<!-- end: Header -->

<div class="container-fluid content">

    <div class="row">

        <!-- start: Main Menu -->
        <div class="sidebar ">

            <div class="sidebar-collapse">
                <div class="sidebar-header t-center">
                    <span><img class="text-logo" src="../assets/img/logo1.png"><i
                            class="fa fa-space-shuttle fa-3x blue"></i></span>
                </div>
                <div class="sidebar-menu">
                    <ul class="nav nav-sidebar">
                        <li><a href="/articleManager/index"><i class="fa fa-laptop"></i><span class="text"> 信息管理</span></a></li>
                        <li><a href="/introManager/list"><i class="fa fa-laptop"></i><span class="text"> 介绍管理</span></a></li>

                    </ul>
                </div>
            </div>
            <div class="sidebar-footer">

                <div class="sidebar-brand">
                    Proton
                </div>
            </div>

        </div>
        <!-- end: Main Menu -->

        <!-- start: Content -->
        <div class="main sidebar-minified">

            <div class="row">
                <div class="col-lg-12">
                    <h3 class="page-header"><i class="fa fa-table"></i>图片上传</h3>
                    <ol class="breadcrumb">
                        <li><i class="fa fa-home"></i><a href="/articleManager/index">主页</a></li>
                        <li><i class="fa fa-table"></i>图片上传</li>
                    </ol>
                </div>
            </div>

            <div class="row">
                <div class="col-md-10">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h2><i class="fa fa-indent red"></i><strong>图片上传</strong></h2>
                        </div>
                        <div class="panel-body">
                            <form id="imgUpdate" action="/articleManager/updateImg" method="post" enctype="multipart/form-data" class="form-horizontal ">
                                <div class="form-group">
                                    <label class="col-md-3 control-label">ID</label>
                                    <div class="col-md-9">
                                        <input id="o_id" type="text"  name="o_id" class="form-control" readonly="readonly">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 control-label">现有图片</label>
                                    <div class="col-md-9">
                                        <input id="o_pic_old" type="text"  name="o_pic_old" class="form-control" readonly="readonly">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 control-label">上传图片</label>
                                    <div class="col-md-9">
                                        <input type="file" id="o_pic" name="o_pic"/>
                                    </div>
                                </div>

                                <br>
                            </form>
                        </div>
                        <div class="panel-footer">
                            <button id="update" type="button" class="btn btn-sm btn-success"><i class="fa fa-dot-circle-o"></i> 保存</button>
                            <!--<button type="reset" class="btn btn-sm btn-danger"><i class="fa fa-ban"></i> Reset</button>-->
                        </div>
                    </div>
                </div>

            </div>
            <!-- end: Content -->
            <br><br><br>

        </div><!--/container-->

        <div class="clearfix"></div>


        <script>

            $(function () {
                var o_id = GetQueryString("o_id");

                getData(o_id);

                $("#update").click(function () {
                    $("#imgUpdate").submit();
                });
            });



            // 获取url参数
            function GetQueryString(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                var r = window.location.search.substr(1).match(reg);
                if (r != null)return unescape(r[2]);
                return null;
            }

            function getData(o_id){
                $.ajax({
                    type: 'post',
                    url: '/articleManager/get_other_detail',
                    data: {
                        o_id:o_id
                    },
                    success: function (data) {
                        $("#o_id").val(data.o_id);
                        $("#o_pic_old").val(data.o_pic);
                    },
                    error: function (result) {
                        console.log(result)
                    }
                });
            }
            //console.log(GetQueryString("o_id"));
        </script>
    </div>
</div>
</body>
</html>